<template>
  <div class="config-panel">
    <h4>{{ title }}</h4>
    <el-form label-position="top">
       <el-form-item label="是否启用">
        <el-switch v-model="config.enabled"></el-switch>
      </el-form-item>
       <el-form-item label="模块标题">
        <el-input v-model="config.title" placeholder="例如：最新资讯" />
      </el-form-item>
      <!-- 资讯模块通常没有太多可配置项，主要是控制显示/隐藏和标题 -->
    </el-form>
  </div>
</template>

<script>
export default {
  name: "NewsConfig",
  props: ['value', 'title'],
  computed: {
    config: {
      get() {
        if (this.value.enabled === undefined) this.$set(this.value, 'enabled', true);
        return this.value;
      },
      set(newValue) { this.$emit('input', newValue); }
    }
  }
}
</script>

<style scoped>
/* ... 粘贴之前回答中提供的 config-panel 样式 ... */
.config-panel { border: 1px solid #f0f0f0; padding: 15px; border-radius: 4px; margin-bottom: 20px; }
h4 { margin-top: 0; }
</style>
